home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
001a
/
autonan.zip
/
NANET.SLT
< prev
Wrap
Text File
|
1991-09-12
|
4KB
|
165 lines
str user_name[] = "Haig Zone"; // Your name
str door_cmd[] = "QMAIL4R PROMPTS"; // Command to open door
str dial_entries[] = "2 3 4"; // Entries to dial
str capture_name[] = "CRS.CAP"; // Capture file name
str reply_name[] = "CRS.REP"; // Reply file name
//////////////////////////////////////////////////////////////////////////////
int errcode;
main ()
{
errcode = 0;
if (!dial (dial_entries,10,0))
exittelix (1,1);
if (fexist (capture_name))
fdelete (capture_name);
capture (capture_name);
logon();
gettodoor();
if (fexist (reply_name))
sendreplies();
getnew();
exittelix (errcode,0);
}
logon() // PCBOARD.SLT included with Telix
{
int stat;
int t1,t2,t3,t4;
int tmark;
if (not _entry_pass) // no pass, so didn't recog. board
{
prints ("Sorry, I don't know the password for this BBS!");
return;
}
t1 = track (" graphics", 1);
t2 = track ("first name?", 1);
t3 = track ("Password", 1);
t4 = track ("Language # to use", 1);
tmark = timer_start (1800); // wait up to 3 minutes for login
// answer any logon questions
while (not time_up (tmark))
{
terminal(); // let Telix process any chars and keys
stat = track_hit (0); // see which (if any) track was hit
if (stat == t1) // say whether we want graphics
{
delay (5);
cputs ("y q^M");
}
else if (stat == t2) // send name
{
cputs (user_name);
cputs ("^M");
}
else if (stat == t3) // send password
{
cputs (_entry_pass);
cputs ("^M");
break; // done with logon
}
else if (stat == t4) // specific to CRS
{
delay (5);
cputs ("3^M");
}
}
if (time_up (tmark))
prints ("Logon failed!");
timer_free (tmark); // free timer channel
track_free (0); // and all track channels
}
gettodoor()
{
int stat;
int t1,t2,t3;
t1 = track ("(H)elp, More?",0);
t2 = track ("(Enter)=yes?",0);
t3 = track ("Command?",0);
while (carrier())
{
terminal(); // let Telix process any chars and keys
stat = track_hit (0); // see which (if any) track was hit
if (stat == t1 || stat == t2)
cputs ("N^M");
else if (stat == t3)
{
cputs (door_cmd);
cputs ("^M");
break;
}
}
track_free (0); // and all track channels
}
sendreplies()
{
if (waitfor ("<COMMAND>",180)) {
cputs ("U^M");
if (waitfor ("<UPLOAD>",60)) {
if (send ('Z',reply_name)) {
fdelete (reply_name);
return 1;
}
}
}
errcode = errcode + 2;
return 0;
}
getnew()
{
int old_auto;
int tmark;
old_auto = _zmod_auto;
_zmod_auto = 0;
if (waitfor ("<COMMAND>",180)) {
cputs ("D;Y;G^M");
if (waitfor ("<DOWNLOAD>",600)) {
if (receive('Z',"")) {
_zmod_auto = old_auto;
tmark = timer_start (6000);
while ((not time_up(tmark)) and carrier())
{
terminal();
}
timer_free (tmark);
return 1;
}
}
}
errcode = errcode + 4;
return 0;
}
fexist (str name)
{
int handle;
handle = fopen (name,"r");
if (handle == 0) return 0;
fclose (handle);
return 1;
}